home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / m68k / fbug68k.arc / ASMHANDL.ERS < prev    next >
Text File  |  1989-08-17  |  4KB  |  182 lines

  1. #include "targetsys.h"
  2. file "asmhandler.s"
  3. text
  4. global stackptr,handler,asmhandler,regdata,handlerflag
  5.  
  6. SUSP:        long    regdata+8
  7. SMSP:        long    regdata+12
  8. SISP:        long    regdata+16
  9. SVBR:        long    regdata+20
  10. SCACR:        long    regdata+24
  11. SCAAR:        long    regdata+28
  12. SSFC:        long    regdata+32
  13. SDFC:        long    regdata+36
  14. SD0:        long    regdata+40
  15.  
  16. #if(DEVICE==68030)
  17. SCRP:        long    regdata+104
  18. SSRP:        long    regdata+112
  19. STC:        long    regdata+120
  20. STT0:        long    regdata+124
  21. STT1:        long    regdata+128
  22. SMMUSR:        long    regdata+134
  23. #endif
  24.  
  25. #if(DEVICE==68040)
  26. SURP:        long    regdata+104
  27. SSRP:        long    regdata+112
  28. STC:        long    regdata+120
  29. SDTT0:        long    regdata+124
  30. SDTT1:        long    regdata+128
  31. SITT0:        long    regdata+132
  32. SITT1:        long    regdata+136
  33. SMMUSR:        long    regdata+142
  34. #endif
  35.  
  36. #if(DEVICE==68040 || COPROCESSOR==TRUE)
  37. FPCR:        long    regdata+144
  38. FPSR:        long    regdata+148
  39. FPIAR:        long    regdata+152
  40. FP0:        long    regdata+156
  41. #endif
  42.  
  43. asmhandler:    
  44.         mov.l    %a7,stackptr
  45.         movm.l    &0xffff,([SD0])
  46.         mov.l    %usp,%d0
  47. #if(DEVICE>=68010)
  48.         mov.l    %vbr,%d1
  49.         mov.l    %sfc,%d2
  50.         mov.l    %dfc,%d3
  51. #endif
  52. #if(DEVICE>=68020)
  53.         mov.l    %isp,%d4
  54.         mov.l    %msp,%d5
  55.         mov.l    %caar,%d6
  56.         mov.l    %cacr,%d7
  57. #endif
  58.         mov.l    %d0,([SUSP])
  59. #if(DEVICE>=68010)
  60.         mov.l    %d1,([SVBR])
  61.         mov.l    %d2,([SSFC])
  62.         mov.l    %d3,([SDFC])
  63. #endif
  64. #if(DEVICE>=68020)
  65.         mov.l    %d4,([SISP])
  66.         mov.l    %d5,([SMSP])
  67.         mov.l    %d6,([SCAAR])
  68.         mov.l    %d7,([SCACR])
  69. #endif
  70. #if(DEVICE==68030)
  71.         lea    (regdata),%a0
  72.         short    0xf028
  73.         short    0x4e00
  74.         short    0x0068        #pmove crp,(104,a0)
  75.         short    0xf028
  76.         short    0x4a00
  77.         short     0x0070        #pmove msrp,(112,a0)
  78.         short    0xf028
  79.         short    0x4200
  80.         short    0x0078        #pmove mtc,(120,a0)
  81.         short    0xf028
  82.         short    0x0a00
  83.         short    0x007c        #pmove mtt0,(124,a0)
  84.         short    0xf028
  85.         short    0x0e00
  86.         short    0x0080        #pmove mtt1,(128,a0)
  87.         short    0xf028
  88.         short    0x6200
  89.         short    0x0086        #pmove mmusr,(134,a0)
  90. #endif
  91. #if(DEVICE==68040)
  92.         lea    (regdata),%a0
  93.                     #68040 instructions to effect supervisor
  94.                     #programer model support should be
  95.                     #inserted here and below !
  96. #endif
  97. #if(DEVICE==68040 || COPROCESSOR==TRUE)
  98.         lea    (regdata),%a0
  99.         short    0xf228
  100.         short    0xb000
  101.         short    0x0090         #fmove.l fpcr,(&144,a0)
  102.         short    0xf228
  103.         short    0xa800
  104.         short    0x0094         #fmove.l fpsr,(&148,a0)
  105.         short    0xf228
  106.         short    0xa400
  107.         short    0x0098         #fmove.l fpiar,(&152,a0)
  108.         short    0xf228
  109.         short    0xf0ff
  110.         short    0x009c         #fmovem.l fp0-fp7,(&156,a0)
  111. #endif
  112.         jsr    handler
  113.         cmp.b    handlerflag,&0
  114.         blt    backtomonitor
  115.         mov.l    ([SUSP]),%d0
  116. #if(DEVICE>=68010)
  117.         mov.l    ([SVBR]),%d1
  118.         mov.l    ([SSFC]),%d2
  119.         mov.l    ([SDFC]),%d3
  120. #endif
  121. #if(DEVICE>=68020)
  122.         mov.l    ([SISP]),%d4
  123.         mov.l    ([SMSP]),%d5
  124.         mov.l    ([SCAAR]),%d6
  125.         mov.l    ([SCACR]),%d7
  126. #endif
  127.         mov.l    %d0,%usp
  128. #if(DEVICE>=68010)
  129.         mov.l    %d1,%vbr
  130.         mov.l    %d2,%sfc
  131.         mov.l    %d3,%dfc
  132. #endif
  133. #if(DEVICE>=68020)
  134.         mov.l    %d4,%isp
  135.         mov.l    %d5,%msp
  136.         mov.l    %d6,%caar
  137.         mov.l    %d7,%cacr
  138. #endif
  139.         movm.l    ([SD0]),&0xffff
  140. #if(DEVICE==68030)
  141.         lea.l     (SCRP),%a0
  142.         short    0xf010
  143.         short    0x4c00        #pmove (a0),crp
  144.         lea.l     (SSRP),%a0
  145.         short    0xf010
  146.         short    0x4800        #pmove (a0),srp
  147.         lea.l     (STC),%a0
  148.         short    0xf010
  149.         short    0x4000        #pmove (a0),tc
  150.         lea.l     (STT0),%a0
  151.         short    0xf010
  152.         short    0x0800        #pmove (a0),tt0
  153.         lea.l     (STT1),%a0
  154.         short    0xf010
  155.         short    0x0c00        #pmove (a0),tt1
  156.         lea.l     (SMMUSR),%a0
  157.         short    0xf010
  158.         short    0x6000        #pmove (a0),psr
  159. #endif
  160. #if(DEVICE==68040)
  161.                     #68040 instructions to effect supervisor
  162.                     #programer model support should be
  163.                     #inserted here !
  164. #endif
  165. #if(DEVICE==68040 || COPROCESSOR==TRUE)
  166.         lea.l     (FPCR),%a0
  167.         short    0xf210
  168.         short    0x9000         #fmove.x (a0),fpcr
  169.         lea.l     (FPSR),%a0
  170.         short    0xf210
  171.         short    0x8800         #fmove.x (a0),fpsr
  172.         lea.l     (FPIAR),%a0
  173.         short    0xf210
  174.         short    0x8400         #fmove.x (a0),fpiar
  175.         lea.l     (FP0),%a0
  176.         short    0xf210
  177.         short    0xd0ff         #fmovem.x (a0),fp0-fp7
  178. #endif
  179.         rte
  180. backtomonitor:    mov.w    &0x2700,%sr
  181.         jmp    abortstart
  182.